package com.fs.sys.web;

import com.fs.sys.service.KaptchaService;
import jakarta.annotation.security.PermitAll;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 图形验证码控制器
 *
 * @author  LiuQi 2025/6/19-10:41
 * @version V1.0
 **/
@RestController
@RequestMapping("/sys/image-code")
public class ImageCodeController {
    @Autowired
    private KaptchaService kaptchaService;

    @GetMapping("generate")
    @PermitAll
    public String generateImageCode(String key) {
        return kaptchaService.generate(key);
    }
}
